package com.nineclock.system.feign;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
@FeignClient("sys-service")
public interface SysOrganizationFeign {

    @GetMapping("/organization/department/top")
    public Result<List<Long>> queryDepartmentIds();

    //如果是feign接口中的get请求， 参数必须加@RequestParam
    @GetMapping("/organization/department/membernum")
    public Result<Integer> queryUserCountByDepartmentIds(@RequestParam("departmentIds") List<Long> departmentIds) ;


    @GetMapping("/department/allDepId/{companyUserId}")
    public Result<List<Long>> queryDepartmentsByUserId(@PathVariable("companyUserId") Long companyUserId) ;


    @GetMapping("/organization/members/simple")
    public Result<List<SysCompanyUserDTO>> queryAllCompanyUser();

    //根据企业ID查询企业的主管理员信息
    @GetMapping("/companyUser/queryAdminByCompanyId")
    public Result<SysCompanyUserDTO> queryAdminByCompanyId(@RequestParam(value = "companyId", required = false)Long companyId);

    @GetMapping("/companyUser/queryAllUserByCompanyId")
    public Result<List<SysCompanyUserDTO>> queryAllUserByCompanyId(@RequestParam(value = "companyId") Long companyId);
}

